
import React, { useState } from "react";
import "./index.less";

interface Iprops {
    checked: boolean;
    change: Function;
    label?: string;
    classN?: string;
}
const UiCheckbox = (props: Iprops) => {
    const { checked, change, label, classN } = props;
    return (
        <div className={`ui-checkbox-bg ${classN}`} onClick={change.bind(this, !checked)}>
            <div className="ui-checkbox">
                <span className={`ant-tree-checkbox ant-tree-checkbox-${checked ? "checked" : ""}`}>
                    <span className="ant-tree-checkbox-inner"></span>
                </span>
            </div>
            <span className="ui-checkbox-label">{label}</span>
        </div>
    );
};
export default UiCheckbox;
